package com.sunl.mall.ali.mq.serializer;

import com.aliyun.openservices.shade.org.apache.commons.lang3.SerializationException;
import com.sunl.mall.ali.mq.model.RocketMqMessageBody;

@FunctionalInterface
public interface RocketMqSerializer<T> {
    /**
     * 序列化
     *
     * @param body 消息体
     * @return byte[]
     * @throws SerializationException ex
     */
    byte[] serialize(RocketMqMessageBody<T> body) throws SerializationException;
}
